Microcontroller clock calibration using data transmission from an accurate third party

ABSTRACT

Systems and methods are provided for calibrating the internal oscillator of a microcontroller from a remote clock source. In some embodiments, an electronic device can request timing information from a third party device using a timing independent signal. The timing information received from the third party device may be used to calibrate the microcontroller clock of the electronic device. In some embodiments, the internal oscillator may be calibrated based on timing information received from multiple third party devices. Once calibrated, the microcontroller may initiate timing dependent communication with other electronic devices using a timing dependent protocol, such as a serial protocol.

FIELD OF THE INVENTION

This can relate to clocking for electronic devices and, moreparticularly, to obtaining a reliable clock signal from a third partyelectronic device for microcontroller clock calibration.

BACKGROUND OF THE DISCLOSURE

Currently, there are a wide variety of electronic devices in everydayuse. For example, many individuals own cellular telephones and portablemedia players for on-the-go communication and entertainment. There areeven electronic devices that are specifically designed to be accessorydevices to other electronic devices, such as wireless Bluetooth™headsets for cellular telephones. These accessory devices may enhancethe functionality, convenience, or aesthetics of another electronicdevice. For example, a wireless Bluetooth™ headset may enhance the useof a cellular telephone by allowing users to have a hands-free, wirelessconversation through their cellular telephone. Similarly, a dockingdevice may be an accessory to a portable media player, where the dockingdevice is used to update and provide power to the portable media player.

Two or more electronic devices, such as a device and its accessorydevice, can communicate using an established protocol. For example, thedevices may communicate using a serial interface, such as a universalserial bus (“USB”) interface. For USB protocols and other serialprotocols, the transfer of information occurs at an agreed upon datarate. If either device loses its ability to accurately transmit orreceive information at that data rate, synchronization may be lost andcommunication may cease. Therefore, each of the devices typicallyincludes a reliable clock source for use in maintaining data transfer atthe agreed upon data rate. Electronic devices often use crystaloscillators as this reliable clock source.

Although crystal oscillators are reliable and accurate, they haveseveral disadvantages. First, they are large components. For a portabledevice, where size is a crucial factor in its design, having such alarge component in the device is highly undesirable. Moreover, crystaloscillators are typically expensive components and are also a commonsource of manufacturing defects in commercial electronic devices.Accordingly, it would be beneficial to be able to provide an approachfor a microcontroller-based electronic device to accurately transmit andreceive serial data without including an extra clock source.

SUMMARY OF THE DISCLOSURE

Systems and methods are provided for calibrating the internal oscillatorof a microcontroller based on a remote clock source.

In one embodiment of the invention, timing dependent communicationbetween a first electronic device and a second electronic device can beenabled. A timing independent signal may be transmitted from the firstdevice to a third party device to request transmission of timinginformation, and a clock source of the first device can be calibratedbased on the timing information transmitted from the third party deviceand received by the first device. Then, timing dependent communicationmay be conducted between the first device and the second device, wherethe data rate of the timing dependent communication is based on a clockrate of the clock source.

In another embodiment of the invention, timing information can betransmitted from a first electronic device to a second electronicdevice. The first device can include a reliable clock source, such as acrystal oscillator, and the second device can include a microcontrollerwith an internal oscillator. First, a timing independent signal can bereceived with the first device from the second device. A request fortiming information can be detected with the first device from thereceived timing independent signal. For example, the first device candetect a request by detecting a voltage change of the timing independentsignal. Timing information may then be transmitted from the first deviceto the second device. The timing information may be derived from thereliable clock source of the first device, and the timing informationmay be used by the second device to calibrate the internal oscillator ofits microcontroller.

In still another embodiment of the invention, a system is provided thatcan include a third party device and a first electronic device coupledto the third party device. The third party device can include a reliableclock source and can be configured to transmit timing information thatis derived from the reliable clock source in response to receiving atiming independent request. The third party device may be, for example,a wireless headset with a crystal oscillator as its reliable clocksource. The first device can include a microcontroller with an internaloscillator. The first device can be configured to transmit the timingindependent request to the third party device and calibrate the internaloscillator with the timing information received from the third partydevice. The first device may be, for example, a docking device adaptedto be an accessory device for the third party device.

The system may further include a second electronic device that cancommunicate with the first device. The first and second devices maycommunicate using a timing dependent protocol, such as a USB protocol.The second device may be, for example, a portable media player, and thefirst device may be a docking device adapted to be an accessory devicefor the portable media player.

In still another embodiment of the invention, an electronic device isprovided that can include a first and a second communication link. Thefirst communication link can be adapted to transmit a request for timinginformation using a timing independent protocol, and the secondcommunication link can be adapted to receive the timing information. Theelectronic device can also include a microcontroller that can controloperations of the electronic device. An internal oscillator of themicrocontroller can be calibrated based on the received timinginformation.

The electronic device may also include a regulator and a switch. Theregulator can provide a first voltage and a second voltage differentfrom the first voltage. The switch can selectively provide one of thevoltages to the first communication link. The request for timinginformation may be transmitted from the first communication link bychanging a state of the switch for a period of time.

In still another embodiment of the invention, a clock source of a firstelectronic device can be calibrated for use in enabling timing dependentcommunication between the first electronic device and a secondelectronic device. A request for timing signals can be transmitted fromthe first device to a plurality of third party devices using a timingindependent protocol. In response to the request, a plurality of timingsignals may be received with the first device from the plurality ofthird party devices, and the first device can derive timing informationfrom at least a subset of the timing signals. For example, the timinginformation may be derived by averaging the at least a subset of thetiming signals. Then, the clock source of the first device may becalibrated based on the timing information.

BRIEF DESCRIPTION OF THE DRAWINGS

The above and other aspects and advantages of the invention will becomemore apparent upon consideration of the following detailed description,taken in conjunction with the accompanying drawings, in which likereference characters refer to like parts throughout, and in which:

FIG. 1 shows a simplified system diagram in accordance with anembodiment of the invention;

FIG. 2 shows an illustrative timing diagram for calibrating amicrocontroller clock in accordance with an embodiment of the invention;

FIG. 3 shows a simplified block diagram of an electronic device inaccordance with an embodiment of the invention;

FIG. 4 shows a simplified circuit for providing a clock signal for amicrocontroller in accordance with an embodiment of the invention;

FIG. 5 shows a simplified block diagram of a third party electronicdevice in accordance with an embodiment of the invention;

FIG. 6 shows another illustrative timing diagram for calibrating amicrocontroller clock in accordance with an embodiment of the invention;

FIGS. 7 and 8 show illustrative flow diagrams for initiatingcommunication with an electronic device in accordance with variousembodiments of the invention;

FIG. 9 shows an illustrative flow diagram for calibrating amicrocontroller clock based on a plurality of timing signals inaccordance with an embodiment of the invention;

FIG. 10 shows an illustrative flow diagram for transmitting a timingsignal for clock calibration in accordance with an embodiment of theinvention; and

FIGS. 11 and 12 show illustrative flow diagrams for maintainingcommunication with a second device in accordance with variousembodiments of the invention.

DETAILED DESCRIPTION OF THE DISCLOSURE

An electronic device in accordance with an embodiment of the inventioncan include a microcontroller for controlling the basic operation of theelectronic device. In some embodiments, the electronic device may be anaccessory device, such as a microcontroller-based docking device for oneor more other electronic devices. The microcontroller of the electronicdevice may have an internal oscillator, sometimes referred to herein asa microcontroller clock, that relies on a reliable clock source formaintaining a consistent and accurate frequency.

Instead of including a reliable clock source on the electronic device tocalibrate the microcontroller clock, a clocking signal may be obtainedfrom another electronic device that has a reliable clock source. Theother electronic device may be, for example, a Bluetooth™ wirelessdevice having a crystal oscillator. In the embodiment where themicrocontroller-based electronic device is a docking device, this otherelectronic device may be one of the devices that couples to the dockingdevice. The other electronic device may be sometimes referred to hereinas a “third party device,” because, in some embodiments, and for anygiven period of time, the third party device may not communicate withthe electronic device other than to provide a clocking signal. However,the term “third party” is not intended to limit the invention to anyparticular type of device, or to any particular functionality other thanproviding a clocking signal.

The electronic device can request transmission of timing information(e.g., a clocking signal) for microcontroller clock calibration from thethird party device. The electronic device may request timinginformation, for example, when it is no longer able to partake intiming-based communication or “timing dependent communication” (e.g.,USB) with other devices. Alternatively, the electronic device mayrequest timing information periodically irrespective of its ability topartake in timing dependent communication. In some embodiments, theelectronic device may provide power to the third party device, and maytransmit a request for timing information by changing the voltage on thepower line from, for example, 5 volts to 3.3 volts for a period of timesufficient for the third party device to detect the change. This or anyother voltage-based out-of-band signaling technique does not depend onthe data rate of the transmitted request, and therefore may be referredto as “timing independent.” A timing independent protocol can beadvantageous, as accurate transmission of the request does not rely onthe microcontroller clock having an accurate frequency.

In response to detecting the voltage change, the third party device maybegin transmitting timing information. The transmission rate of thetiming information may depend on the rate of the reliable clock sourceof the third party device. The electronic device can use the receivedtiming information to calibrate the internal oscillator of itsmicrocontroller. After proper calibration, the microcontroller clock maybe sufficiently accurate to perform any suitable timing dependentfunctions. For example, the electronic device can initiate timingdependent communication with a second electronic device, which may bethe third party device or a different electronic device. After apredetermined period of time, or if proper communication ceasesunexpectedly, the electronic device may again request timing informationfrom the third party device.

In some embodiments, the electronic device may derive timing informationfor its microcontroller clock from multiple signals received fromdifferent third party devices. The electronic device can, for example,average the received signals to produce the timing information. Inaddition, one or more of the signals can be selected based on anysuitable criteria, such as the magnitude of the received signals or thepriority of the ports from which the signals were received.

Methods and systems for calibrating the internal oscillator of amicrocontroller based on a remote clock source are provided anddescribed with reference to FIGS. 1-12.

FIG. 1 shows a simplified block diagram of system 100, and is intendedto represent any collection of two or more electronic devices that areconfigured to communicate with one another in accordance with theinvention. In the illustrated embodiment, system 100 includes threeelectronic devices: third party device 102, accessory device 104, andportable electronic device 106.

Third party device 102 can be any suitable electronic device thatincludes a clock source 108. Clock source 108 may be a crystaloscillator or any other source that can reliably provide an accurateclock signal at a fixed or controllable frequency. Third party device102 can use the signal provided by clock source 108 to derive andtransmit a clocking signal to accessory device 104, and to enable itsown timing dependent communication. For example, third party device 102can be a wireless headset that uses its reliable clock source for USBcommunication. In this embodiment, third party device 102 may have anyof the components, features, or functionalities of the wireless headsetsdiscussed in commonly assigned U.S. Patent Application Publication No.2008/0164934 , published Jul. 10, 2008 (hereinafter “the headsetapplication”), which is hereby incorporated herein by reference in itsentirety.

Accessory device 104 can be any suitable microcontroller-basedelectronic device, and can include a microcontroller 110 for controllingthe basic operation of the device. In some embodiments, accessory device104 may be a docking device-type accessory for portable electronicdevice 106 and/or third party device 102. For example, accessory device104 may have any of the components, features, or functionalities of thedocking devices discussed in co-pending, commonly assigned U.S. PatentApplication Publication No. 2008/0167088 , published Jul. 10, 2008(hereinafter “the docking application”), which issued Dec. 27, 2011 asU.S. Pat. No. 8,086,281, and which is hereby incorporated herein byreference in its entirety.

Microcontroller 110 of accessory device 104 may be any suitablemicrocontroller that can use a clock source external to microcontroller110 to calibrate its internal oscillator 111. As described above,accessory device 104 can obtain timing information from third partydevice 102, and can calibrate microcontroller 110 based on the receivedclocking signal. Thus, the signal used by microcontroller 110 tocalibrate its internal oscillator 111 may be based on the reliable clocksignal of clock source 108. This signal obtained from third party device102 may be sometimes referred to herein as “timing information.” Becausethe timing information is timing dependent, the timing information mayalso be referred to as a “timing dependent signal” or simply a “timingsignal.”

Portable electronic device 106 can be any suitable electronic devicecapable of communicating with accessory device 104. Portable electronicdevice 106 may communicate with accessory device 104 to obtain updates,information, or power. For example, portable electronic device 106 maybe a portable media player (e.g., an iPod™) or a cellular telephone(e.g., an iPhone™) that can obtain power, media file downloads, softwareupdates, user preference settings, synchronization settings, or anyother suitable information from accessory device 104. In someembodiments, portable electronic device 106 may not be “portable,” butmay be designed for use in a fixed location.

As shown in FIG. 1, third party device 102, accessory device 104, andelectronic device 106 may be coupled via communications links. Inparticular, third party device 102 may communicate with accessory device104 via communications link 112, and accessory device 104 maycommunicate with electronic device 106 via communications link 114.Communications links 112 and 114 can include any number and combinationof suitable wired or wireless paths for enabling timing independent ortiming dependent communication. Communications links 112 and 114 caninclude power lines, serial data lines, coaxial cables, standard cablesfor given communications protocols, or space for wireless datatransmission. Although not shown in FIG. 1, in some embodiments, thirdparty device 102 may directly communicate with portable electronicdevice 106 through another communications link. Alternatively, thirdparty device 102 may indirectly communicate with portable electronicdevice 106 through accessory device 104 and communications links 112 and114.

In some embodiments, accessory device 104 may communicate with portableelectronic device 106 using a serial interface or another timingdependent interface. Thus, communication between these devices may relyon the ability of accessory device 104 and portable electronic device106 to maintain an agreed upon data rate. Because accessory device 104may not include a reliable clock source (e.g., a crystal oscillator) forclocking microcontroller 110, the internal oscillator of microcontroller110 may be susceptive to deviation from its normal frequency, therebypotentially preventing reliable communication between the two devices.To maintain reliable communication, accessory device 104 may requesttiming information from third party device 102 for use in recalibratingits microcontroller clock 111. However, especially in cases wherecommunication ceases between accessory device 104 and portableelectronic device 106, timing dependent communication also may not bepossible between third party device 102 and accessory device 104. Thus,in various embodiments of the invention, accessory device 104 can beconfigured to transmit to third party device 102 a timing independentrequest for timing information. Third party device 102 may be configuredto detect the timing independent request, and, in response, may transmittiming information to accessory device 104. An example of this approachis illustrated in FIG. 2.

FIG. 2 shows timing diagram 200 that illustrates one approach foraccessory device 104 to reliably request and obtain timing informationfrom third party device 102, and will be described with continuingreference to FIG. 1. Timing diagram 200 illustrates three signals: thefirst (“request”) representing a request for timing information that maybe transmitted from accessory device 104 to third party device 102, thesecond (“RX”) representing timing information that may be received byaccessory device 104 from third party device 102, and the third (“TX”)representing a timing dependent signal that may be transmitted byaccessory device 104 at the completion of clock calibration. Forclarity, the description below of timing diagram 200, and any othertiming diagrams described herein, assumes that a signal transmitted fromone device is the same signal received by the other device, and viceversa.

Accessory device 104 may initiate a request for timing information atsome time, t₁. Accessory device 104 may automatically initiate arequest, for example, when it is no longer able to communicate using atiming independent protocol, after a predetermined period of time, orwhen a previous attempt at clock calibration is unsuccessful. At timet₁, accessory device 104 may enter into a state, which may sometimes bereferred to herein as a “CALIBRATION state,” that can occur wheneveraccessory device 104 recalibrates its microcontroller clock 111. InCALIBRATION state, accessory device 104 may suspend any timing dependentfunctions, such as timing dependent communication with portableelectronic device 106.

To request transmission of timing information from third party device102, accessory device 104 may transmit a timing independent signal tothird party device 102 at time t₁. Therefore, as described above, evenif an internal oscillator of microcontroller 110 cannot maintain timingdependent communication, a request for timing information can still bereliably transmitted. In some embodiments, accessory device 104 mayinitiate the request at time t₁ by switching the request voltage from afirst voltage V₁ to a second voltage V₂ for a period of time sufficientfor third party device 102 to detect the change. The voltage change cancreate voltage pulse 202. For example, if third party device 102 detectsthe voltage change at some time t₂, pulse 202 may be of sufficientlength to initiate transmission of timing information from third partydevice 102. This timing independent approach illustrates one form oftiming independent communication that may be sometimes referred toherein as “level-based signaling.” In other embodiments,transmission-based signaling, where third party device 102 may beconfigured to detect a transition in the request signal, may be used tocommunicate a request for timing information.

As described above, at time t₂, third party device 102 may determinethat a request for timing information has been received. In response toreceiving the request, third party device 102 may begin transmittingtiming information 204 at time t₂. Timing information 204 can be anysuitable signal that enables accessory device 104 to calibrate itsmicrocontroller clock 111. In some embodiments, and as shown in FIG. 2,timing information 204 may be a clock signal with a 50% duty ratio. Inother embodiments, timing information 204 may be a clock signal with adifferent duty ratio or a signal of another suitable sequence orpattern. Third party device 102 may transmit timing information 204 toaccessory device 104 until a time, t₄. The amount of time timinginformation 204 is transferred, or t₄-t₂, may be a period of timesufficient for accessory device 104 to complete microcontroller clockcalibration. For example, if accessory device 104 completesmicrocontroller clock calibration at time t₃, timing information 204 istransmitted for a sufficient amount of time.

With continuing reference to FIGS. 1 and 2, accessory device 104 maycalibrate internal oscillator 111 of microcontroller 110 using timinginformation 204 received from third party device 102. Accessory device104 may enable clock calibration to occur while in CALIBRATIONstate—that is, from time t₁ to a some later time, t₃. The time betweent₁ and t₃ may be a predetermined amount time programmed or hardwiredinto accessory device 104, after which proper clock calibration isassumed to have been completed. If clock calibration is completedsuccessfully, accessory device 104 may be capable of performing timingdependent tasks.

At time t₃, accessory device 104 may enter into a new state, which maysometimes be referred to herein as a “COMMUNICATION state.” In thisstate, accessory device 104 may disable microcontroller clockcalibration, and may initiate or resume any timing dependent tasks. Forexample, accessory device 104 can initiate timing dependentcommunication with portable electronic device 106, and can begintransmitting timing dependent data 206 to portable electronic device106. Alternatively, accessory device 104 may begin exchanginginformation with a different device, check connections between variousdevices coupled to accessory device 104, establish connections betweenvarious devices, provide updates to various devices, facilitate transferof data between various devices, etc. These and other tasks that can beperformed by accessory device 104 are described in greater detail in thedocking application, for example.

It should be understood that system 100 of FIG. 1 and timing diagram 200of FIG. 2 are merely illustrative. In fact, system 100 can include anysuitable number of electronic devices with any suitable number ofcommunications links coupling them. Also, the above describedembodiments of third party device 102, accessory device 104, andportable electronic device 106, as well as their functions as describedin connection with FIG. 2, are merely illustrative. Devices 102, 104,and 106 can each be any suitable electronic device capable ofcommunicating with one or more other devices, and do not necessarilyhave a device-accessory relationship. For example, and whereappropriate, each of third party device 102, accessory device 104,portable electronic device 106, and any other device in communicationwith system 100 (not shown) may be any suitable portable or stationaryelectronic device, including but not limited a laptop computer, adesktop computer, an audio player (e.g., a Walkman™, compact discplayer, etc.), a video player, a media player (e.g., an iPod™, etc.), aset top box, a portable video game system (e.g., Sony's PSP™, Nintendo'sGame Boy™, etc.), an electronic book, a cellular telephone, a wirelesstelephone, a hand held computer, a global positioning system (“GPS”)device, a personal digital assistant (“PDA”) (e.g., Palm's Pilot™,etc.), a wireless headset for a telephone, a satellite radio, a remotecontrol, an automobile key fob, a printer, an automobile radio, anautomobile computing system, an automobile cigarette lighter (or othermobile power source, such as an airplane cigarette lighter), a camera,an accessory device for a computer (e.g., a wireless mouse, wirelesskeyboard, etc.), a watch, a surge protector, an AC/DC converter, etc.

FIGS. 3-5 show illustrative embodiments of electronic devices capable ofoperating in accordance with the invention. In particular, FIG. 3 showsan illustrative block diagram of a microcontroller-based electronicdevice capable of transmitting a request for timing information. FIG. 4shows an illustrative block diagram of a clock calibration circuit forprocessing received timing information, which can be implemented on theelectronic device of FIG. 3. Finally, FIG. 5 shows an illustrative blockdiagram of a third party device capable of detecting a request fortiming information and transmitting timing information in response todetecting the request.

Referring first to FIG. 3, a simplified and illustrative block diagramof an accessory device 300 is shown. Accessory device 300 may be a moredetailed, yet still simplified view, of accessory device 104 of FIG. 1.Accessory device 300 can include port 302, port 304, port 306, regulator308, switch 310, and microcontroller 312. Device 300 can be implementedusing a single integrated circuit or, for example, a multi-chip moduleincluding two or more separate integrated circuits. Also, as describedabove, although device 300 is referred to as an “accessory” device, thisis merely one embodiment of device 300. Device 300 can be any suitabletype of electronic device with any suitable relationship to the otherelectronic devices it may communicate with.

The block diagram of accessory device 300 is merely illustrative. Forclarity, the components of accessory device 300 will be described belowmainly in terms of the ability of device 300 to request timinginformation and to calibrate its microcontroller clock based on thereceived timing information. However, it should be understood thataccessory device 300 can have many features and functionalities, and anyadditional components, such as those described in the dockingapplication. Moreover, each component of accessory device 300 may haveany of the features or embodiments described in connection with one ormore corresponding components in the docking application.

Ports 302, 304, and 306 of accessory device 300 can each be any suitabletype of wired or wireless port (e.g., a female USB connector, a male30-pin connector, and a symmetrical 4-pin connector, respectively) thatenables other electronic devices to be coupled to accessory device 300.Ports 302, 304, and 306 can respectively couple powering device 324,portable electronic device 326, and third party device 328 to accessorydevice 300. Powering device 324, coupled via port 302, may be anysuitable type of electronic device discussed above, such as an ACadapter or a computer, that can provide power, among other things, toaccessory device 300 via power supply line 316. Portable electronicdevice 326, coupled via port 304, can be similar in functionality toportable electronic device 106 of FIG. 1. That is, accessory device 300may be operable to provide power, information, or updates to portableelectronic device 326 via power supply line 318, for example. Thirdparty device 328, coupled via port 306, may be similar in functionalityto third party device 102 of FIG. 1. For example, third party device 328may operate in conjunction with accessory device 300 to produce timingwaveforms similar to those shown in timing diagram 200 of FIG. 2.

It should also be understood that, in some embodiments or in someoperating scenarios, power may be provided to device 300 from portableelectronic device 326 or third party device 328 in addition to orinstead of from power device 324. Also, although only three ports areshown in FIG. 3, it should be understood that accessory device 300 mayinclude any suitable number of ports that may couple any suitable numberof devices to accessory device 300.

Microcontroller 312 may have the same or similar features andfunctionality as microcontroller 110 of FIG. 1. Microcontroller 312 mayoperate based on an internal oscillator 311 that relies on another clocksource external to the microcontroller for maintaining an accuratefrequency. For example, microcontroller 312 can be any suitablecommercial 8-bit, 16-bit, or larger microcontroller (e.g., Intel's 8088,etc.) with one or more clock inputs for accepting timing information.Accessory device 300 may include one or more components that enableproper operation of microcontroller 312 (e.g., additional storage unitsfor use as instruction or data memory). Accessory device 300 can obtaintiming information from third party device 328. In some embodiments,accessory device 300 may obtain timing information from other devices aswell.

Microcontroller 312 can facilitate the transfer of information and poweramong the devices coupled to accessory device 300. In particular,microcontroller 312 may facilitate the transfer of power from poweringdevice 324 (via power supply line 316) to third party device 328 andportable electronic device 326 (via power supply line 314 and powersupply line 318, respectively). Also, microcontroller 312 may beconfigured to transmit and receive information to and from and betweenportable electronic device 326 and third party device 328 viatransmit/receive (TX/RX) line 322 and TX/RX line 320, respectively.TX/RX lines 320 and 322 can be bidirectional links or can include one ormore separate transmit and receive links.

Information exchanged via TX/RX lines 320 and 322 can be exchanged usinga timing dependent protocol (e.g., a serial protocol, such as a USBprotocol), where the information data rate may be based on the internaloscillator 311 of microcontroller 312. Thus, the reliability of datatransfer, and the ability to transfer data at all, may depend on theconsistency and accuracy of the internal oscillator 311 ofmicrocontroller 312. Because accessory device 300 may not include areliable clock source for maintaining an accurate microcontroller clockfrequency, accessory device 300 may request timing information fromthird party device 328, or any other device coupled to accessory device300, whenever recalibration of the microcontroller clock 311 isnecessary.

As described above, accessory device 300 may request timing informationusing a timing independent approach (e.g., a level-based ortransition-based approach) to ensure that a request can be accuratelytransmitted even when the internal oscillator 311 of microcontroller 312is inaccurate. In particular, accessory device 300 may transmit arequest by changing power voltage V_(x) provided to third party device328 from a first voltage, V₁ to a second voltage, V₂, or vice versa. Forexample, V₁ may be the voltage typically provided to third party device328 to power or charge the third party device 328. Microcontroller 312can transmit a request by lowering the voltage typically provided tothird party device 328 to a significantly lower voltage, V₂, for apredetermined period of time, for example. Microcontroller 312 caninitiate this request by controlling switch 310 to select betweenoutputs of regulator 308. In this way, microcontroller 312 can generatethe request waveform shown in timing diagram 200 of FIG. 2.

Regulator 308 can regulate power obtained from powering device 324, orfrom any combination of devices coupled to accessory device 300, toobtain various voltages, such as voltages V₁ and V₂. These voltages maybe used to power third party device 328 and portable electronic device326, and may be used to transmit timing independent requests for timinginformation. V₁ and V₂ can be any standard power voltage, such as 3V,3.3V, or 5V, or any nonstandard power voltage. For simplicity, it willbe assumed that V₁ is greater than V₂. Thus, for example, V₁ may be 5volts and may be the voltage typically supplied to third party device328, while V₂ may be 3.3 volts. In some embodiments, regulator 308 maygenerate these two voltages by taking the voltage of power supply line316 as V₁, and stepping down V₁ to obtain V₂. Alternatively, regulator308 may take the voltage of power supply line 316 as V₂ and may boost V₂to obtain V₁, or regulator 308 may derive both V₁ and V₂ from thevoltage at power supply line 316 using some other suitable technique.Regulator 308 can be implemented using any suitable approach (e.g., alinear regulator, a buck/boost regulator, or any other PWM-basedregulator, etc.), and is therefore not limited to any particularimplementation.

Switch 310 of FIG. 3 can provide one of V₁ and V₂ as power supplyvoltage V_(x) for third party device 328, and can be modeled as a singlepole, double throw switch, for example. That is, in one state, switch310 may couple the V₁ output of regulator 308 to power supply line 314,and in another state, switch 310 may couple the V₂ output of regulator308 to power supply line 314. Thus, to initiate a request for timinginformation, microcontroller 312 can change the state of switch 310using, for example, control line 330. This can allow microcontroller 312to apply a pulse on voltage supply line 314 to third party device 328for a time sufficient for third party device 328 to detect the levelchange (for level-based signaling) or the voltage transition (fortransition-base signaling). It should be understood that switch 310 canbe implemented using any suitable technique (e.g., a transistor-basedswitch), and is therefore not limited to any particular implementation.

Microcontroller 312 can receive the timing information from third partydevice 328 via TX/RX line 320, for example. Thus, in some embodiments,TX/RX line 320 may support both the transfer of data as well as thetransfer of timing information. In these embodiments, TX/RX line 320 maybe coupled not only to the data input/outputs (“I/Os”) ofmicrocontroller 312, but also directly or indirectly to the clock inputsof microcontroller 312. In other embodiments, third party device 328 andaccessory device 300 may include a separate communication link (notshown) dedicated to the transfer of timing information. Calibratingmicrocontroller 312 via timing information received from third partydevice 328 or portable electronic device 326, or both, will be describedin greater detail below in connection with FIG. 4.

In some embodiments, timing information may be requested from multipledevices, instead of only from third party device 328. For example,timing information may be requested from both third party device 328 andportable electronic device 326. Microcontroller 312 may control switch310 to transmit the same timing independent request via both powersupply line 314 and power supply line 318. Thus, each request can besignaled to both third party device 328 and portable electronic device326 substantially concurrently. Alternatively, switch 310 may becontrolled to selectively signal requests to one or more particulardevices. For example, switch 310 may provide a first voltage valueV_(x1) for third party device 328 and a second voltage value V_(x2), forportable electronic device 326. Microcontroller 312 may selectivelychange one of these voltage signals to initiate a request with one ofthese devices. Microcontroller 312 may be configured to select aparticular device to receive a request for any suitable reason. Forexample, microcontroller 312 may be configured to transmit a request toonly those ports that have devices coupled to them. Similarly,microcontroller 312 may be configured to send a request to a devicecoupled to either the highest or lowest priority port. Port prioritiesand other determinations that microcontroller 312 may use to control oneor more voltages V_(x) are discussed in greater detail in the dockingapplication, for example.

Accessory device 300 may transmit timing independent requests for timinginformation via power supply line 314. This technique may beadvantageous because an extra communication link dedicated totransmissions of timing independent requests is not necessary. Moreover,many devices (e.g., the wireless headsets described in the headsetapplication) may already be capable of detecting changes in their powersupply voltage, and would not require a substantial amount of extracircuitry to detect requests for timing information. However, it shouldbe understood that in other embodiments, a different communication linkcan be used to transmit requests (e.g., TX/RX link 320) or an extracommunication link can be implemented that is dedicated to thetransmission of these requests.

Referring now to FIG. 4, an illustrative block diagram of clockcalibration circuit 400 is shown for providing timing information to amicrocontroller. Calibration circuit 400 can be implemented as part ofaccessory device 300 of FIG. 3 to provide appropriate timing informationto microcontroller 312. Clock calibration circuit 400 can includeselection circuit 402, tri-state buffer 404, and clock circuit 406.

Selection circuit 402 can derive a timing dependent signal useful forproducing timing information from various inputs, illustrated in FIG. 4as inputs CLK1 through CLKN, for example. Two clocks, CLK1 and CLK2, maybe provided, for example, from third party device 328 and portableelectronic device 326 of FIG. 3 via communications lines 320 and 322,respectively. Thus, selection circuit 402 may be configured to allow asubset of signals received from other devices to affect the timinginformation eventually provided to the microcontroller (e.g.,microcontroller 312 of FIG. 3). In some embodiments, selection circuit402 may be implemented as a single pole, double throw switch, and mayselect one of the CLK inputs to output as the timing independent signal.Selection circuit 402 may make this selection based on the value of aSELECT input 410, for example. In other embodiments, selection circuit402 may average two or more of the clock inputs. For example, selectioncircuit 402 may average the signal values of CLK1 and CLK2 to obtain anew timing dependent signal. In still other embodiments, selectioncircuit 402 may be operable to either select a single CLK input oraverage multiple CLK inputs based on, for example, the value of SELECTinput 410.

SELECT input 410, which may control the selection operation of selectioncircuit 402, may be derived from the microcontroller (e.g.,microcontroller 312 of FIG. 3). The microcontroller can select aparticular operation based on any suitable factors. In some embodiments,the microcontroller may enable the selection of one or more clocks ofgreatest magnitude, or may enable selection based on quality of theinput clock signals. Alternatively, the microcontroller may choose oneor more clocks based on the ports that the CLK input signals originatedfrom.

With continuing reference to FIG. 4, tri-state buffer 404 can beconfigured according to an ENABLE input 412 to allow a signal to passthrough buffer 404, for example, only when the electronic device (e.g.,accessory device 104 of FIG. 1) is in a CALIBRATION state. For theexample of FIG. 2, tri-state buffer 404 may be enabled to pass its inputdata to its output between time t₁ and time t₃, (e.g., the period oftime that timing information may be requested). While the electronicdevice is in a COMMUNICATION state, on the other hand, tri-state buffer404 may be configured to output high impedance. In this way, tri-statebuffer 404 can prevent a different type of signal (e.g., a data signal,a timing independent signal), or a signal transmitted at a frequencyother than the desired frequency, from affecting the internal oscillatorof the microcontroller. ENABLE input 412, which may control the state oftri-state buffer 404, may be controlled by the microcontroller. Thus, atthe time that the microcontroller requests timing information, themicrocontroller can also enable tri-state buffer 404. Then, once themicrocontroller determines that its internal oscillator has finishedrecalibrating, it can disable tri-state buffer 404.

Clock circuit 406 of calibration circuit 400 can include any suitablecircuitry to convert the timing signal provided by selection circuit 402to one or more Xtal input(s) 408 in a format expected by the clock inputof the microcontroller (e.g., microcontroller 312 of FIG. 3). In someembodiments, clock circuit 406 may change the characteristics (e.g.,voltage or current) of the timing signal. Also, clock circuit 406 mayinclude any passive components, such as resistors or inverters, thatwould have been necessary even if a reliable clock source were presentin the microcontroller. In some embodiments, clock circuit 406 mayimprove the quality of the signal provided by selection circuit 402. Forexample, clock circuit 406 may include an operational amplifier-basedcomparator for improving the edges of the signal provided by tri-statebuffer 404.

Referring now to FIG. 5, an illustrative block diagram of a third partydevice 500 is shown in accordance with an embodiment of the invention.In some embodiments, the block diagram of FIG. 5 is a more detailed, yetstill simplified, view of third party device 102 of FIG. 1 or thirdparty device 328 of FIG. 3. Thus, third party device 500 can be coupledto accessory device 300 of FIG. 3, for example, by coupling port 514 ofdevice 500 to port 306 of accessory device 300 of FIG. 3. Third partydevice 500 can include power bus 502, battery 504, detector 506, clocksource 508, processing circuitry 510, communications circuitry 512, andI/O lines Vcc/Vdd and TX/RX.

The block diagram of third party device 500 is merely illustrative. Forclarity, the components of third party device 500 will be describedbelow mainly in terms of their ability to detect requests for timinginformation and to provide timing information in response to detectingthese requests. However, it should be understood that third party device500 can have many functions and functionalities, and any additionalcomponents, such as those described in the headset application.Moreover, each component of third party device 500 may have any of thefeatures or embodiments described in connection with one or morecorresponding components in the headset application.

Processing circuitry 510 can be any suitable combination of hardware,software, or firmware, and any accompanying components (e.g., memoryelements) necessary for controlling the operation of third party device500. Although processing circuitry 510 is shown as a single component,third party device 500 may instead have multiple processing circuitriesthat each have their own specialized functions.

In some embodiments, processing circuitry 510 can provide information toand process information obtained from an accessory device coupledthrough port 514, such as accessory device 300 of FIG. 3. Processingcircuitry 510 may communicate with an accessory device using a timingdependent protocol (e.g., a serial protocol), where the data rate ofcommunication is based on a clock signal provided by clock source 508,for example. Clock source 508 can be any suitable clock source thatprovides a reliable clock signal, such as a crystal oscillator, and maybe the same or a similar clock source as described above in connectionwith clock source 108 of third party device 102 of FIG. 1.

Third party device 500 may include communications circuitry 512 toaccurately exchange information with an accessory device coupled viaport 514. In some embodiments, communications circuitry 512 may includean encoder to convert information provided by processing circuitry 510to information suitable for transmission from device 500, or to convertthe information to a standard transmission format (e.g., USB).Similarly, communications circuitry 512 can include any necessarycircuitry for interpreting information obtained from the coupledaccessory device, such as detectors, error control decoders, or USBdecoders, for example.

As described above, a third party device, such as third party device500, can be a portable electronic device. For example, third partydevice 500 can be a wireless headset. Third party device 500 can includea battery 504 to provide power to the other components of device 500(e.g., processing circuitry 510, communication circuitry 512, etc.).Battery 504 may be any suitable portable powering device, such as alithium ion battery, for example.

Power can also be provided to third party device 500 via one or morepower supply lines. In particular, when an accessory device is coupledto device 500 via port 514, for example, third party device 500 can drawpower from the accessory device using one or more power supply lines.For example, when third party device 500 is connected to accessorydevice 300 of FIG. 3, third party device 500 can obtain power from powersupply line 314 of accessory device 300. The power supply line can beused to provide power of any suitable voltage (e.g., 5V, 3.3V, V₁, V₂,etc.). The power provided by the power supply line can be transported todifferent areas of third party device 500, and to the various componentsof third party device 500, by power bus 502, for example. Power bus 502can be any suitable power line for transporting power across third partydevice 500. In some embodiments, power bus 502 can be coupled to battery504 and can be used to recharge battery 504.

The components of third party device 500 may be selectively powered byeither power bus 502 or battery 504, or both. In some embodiments, powerbus 502 can provide power to some or all of the other components ofthird party device 500 when power can be drawn from a device coupled toport 514. For example, power bus 502 can be used to power one or more ofthe components of third party device 500 (e.g., to all components butcommunications circuitry 512, which may be powered instead by battery504). If power cannot be drawn from another device, the components ofdevice 500 may instead be powered by battery 504. The determination asto which source may power the components of third party device 500 canbe based on the detection results of detector 506. In other embodimentsof the invention, each of the components of third party device 500 maybe powered by battery 504 regardless of whether power can be drawn fromanother device. In such embodiments, the power provided to power bus 502may be used solely to recharge battery 504.

With continuing reference to FIG. 5, detector 506 can be coupled topower bus 502 and can monitor the voltage on power bus 502. Detector 506can provide a signal to processing circuitry 510 when an expected powervoltage (e.g., V₁) on power bus 502 changes to a different voltage(e.g., V₂). As described above, timing information may be transmitted inresponse to detecting such a voltage change. To perform this detection,detector 506 can include any necessary components or circuitry, such asone or more voltage comparators or analog-to-digital converters(“ADCs”). For example, to detect when the voltage on power bus 502 dropsfrom V₁ to V₂, a voltage comparator can be used to detect when thevoltage dips below a certain voltage, (e.g., below a voltage V, whereV₁>V>V₂). In some embodiments, detector 506 can be powered by battery504 to provide a substantially constant power source while monitoringthe voltage on power bus 502.

Processing circuitry 510 can be configured to react to a particularvoltage change on power bus 502 detected by detector 506 (e.g., from V₁to V₂). Thus, when detector 506 detects a request for timinginformation, processing circuitry 510 can react by having timinginformation sent via the TX/RX line. For example, if processingcircuitry 510 includes a microprocessor, a detected voltage change onpower bus 502 may trigger an interrupt sequence to be initiated. Thisinterrupt sequence may include instructions to output timing informationvia TX/RX line through communications circuitry 512.

Third party device 500 and accessory device 300 may be operable tocommunicate according to timing diagram 200 of FIG. 2, thereby enablingaccessory device 300 to recalibrate its microcontroller clock 311 basedon a reliable clock source of third party device 500. Alternatively,another suitable handshaking protocol may be used between the twodevices. One such alternative protocol is illustrated by timing diagram600 of FIG. 6.

FIG. 6 will be described in connection with accessory device 300 andthird party device 500. Timing diagram 600 illustrates four waveforms:the first representing the voltage of power supply line 314 providedfrom accessory device 300 to third party device 500 (V_(x)), the secondrepresenting the information received by accessory device 300 from thirdparty device 500 via TX/RX line 320 (RX_third), the third representingthe information transmitted by accessory device 300 and received bythird party device 500 via TX/RX line 320 (TX_third), and the fourthrepresenting information transmitted by accessory device 300 to anotherelectronic device (e.g. portable electronic device 326) via TX/RX line322 (TX).

At time t₅, accessory device 300 can request timing information fromthird party device 500 by changing power supply voltage V_(x), from afirst voltage, V₁, to a second voltage, V₂, for example. In particular,at this time, microcontroller 312 of accessory device 300 can enter intoa CALIBRATION state, and can be configured to change the state of switch310 to create pulse 602. Microcontroller 312 of accessory device 300 cangenerate pulse 602 for a period of time sufficient for third partydevice 500 to detect the change.

Once third party device 500 detects the voltage change at time t₆ (e.g.,via detector 506), third party device 500 may begin transmitting timinginformation 604 to accessory device 300. The timing information may beused by device 300 to calibrate internal oscillator 311 of itsmicrocontroller 312.

At time t₇, microcontroller 312 of accessory device 300 may transmit apacket of information to third party device 500 using a timing dependentformat. The packet may therefore be transmitted at a rate dependent onthe internal oscillator 311 of microcontroller 312. This timingdependent packet is illustrated in timing diagram 600 as TX_PKT 606,where TX_PKT 606 may be any suitable digital sequence or pattern of anysuitable length. The sequence or pattern transmitted by accessory device300 may be known and expected by third party device 500. If third partydevice 500 is able to accurately interpret TX_PKT 606 at time t₈, properclock calibration can be assumed. In response to accurately receivingTX_PKT 606, third party device 500 may stop transmitting timinginformation 604, and may instead transmit acknowledgment (“ACK”) 608 toaccessory device 300.

Upon receiving acknowledgement 608 of proper clock calibration fromthird party device 500 at time t₉, accessory device 300 may switch fromCALIBRATION state to COMMUNICATION state. Accessory device 300 caninitiate timing dependent communication with third party device 500 orwith any other suitable electronic device (e.g., portable electronicdevice 326 of FIG. 3). In particular, accessory device 300 may transmitdata 610 to another device using a suitable timing dependent protocol(e.g., USB). Other tasks device 300 may perform are discussed above inconnection with timing diagram 200 of FIG. 2.

In some scenarios, proper clock calibration may not have completed byt₇. In this case, timing dependent communication may not be possiblebetween third party device 500 and accessory device 300. Therefore, attime t₈, if third party device 500 is not able to accurately interpretTX_PKT 606 transmitted from accessory device 300, third party device 500may not send acknowledgement 608. In this scenario, accessory device 300may continue to calibrate its clock according to timing information 604,and can transmit TX_PKT 606 again at a later time. Third party device500 may send an acknowledgement once a subsequent TX_PKT is receivedaccurately. Thus, accessory device 300 may continue to calibrate itsmicrocontroller clock and send packets to third party device 500 as manytimes as is necessary (unless a timeout is implemented) to enable timingdependent communication.

Referring now to FIG. 7, an illustrative flow diagram of a process 700is shown for enabling time dependent communication (e.g. using a serialprotocol) between a first electronic device (e.g., accessory device 300of FIG. 3) and a second electronic device (e.g., portable electronicdevice 326). The first electronic device can execute the steps ofprocess 700.

At step 702, the first electronic device may transmit a signal to athird party device (e.g., third party device 500 of FIG. 5). The signalcan be transmitted to request transmission of timing information fromthe third party device. In some embodiments, the signal may be timingindependent and may be provided by changing the power supply voltage ofthe third party device. For example, the voltage of the power line maybe changed from a normal voltage of V₁ (e.g., 5V) to a voltagesubstantially less than V₁ (e.g., 3.3V). Changing the voltage in thisway may allow for transition-based signaling or level-based signaling,neither of which is necessarily dependent on the rate of communication.

After transmitting a request for timing information, the firstelectronic device may receive the requested timing information. Thetiming information may be received after a period of time correspondingto the time it takes for the third party device to detect the request,process the request, and transmit the timing information. The timinginformation can be of any suitable form, such as a clock signal with asuitable duty ratio (e.g., 50%, etc.) or a timing dependent signal witha suitable signaling pattern. At step 704, a microcontroller clock ofthe first device can be calibrated using the received timinginformation. For example, the timing information or a processed versionof the timing information received from the third party device may beprovided to one or more clock inputs of the microcontroller.

With continuing reference to FIG. 7, at step 706, the first electronicdevice can initiate timing dependent communication with anotherelectronic device (e.g., the second electronic device). The timingdependent communication can be of any suitable format or standard, suchas a USB standard. Also, the second electronic device can be any otherdevice, including but not limited to the third party device. Forexample, timing dependent communication can be initiated with portableelectronic device 326 of FIG. 3, which may be an iPod™ or iPhone™. Thetiming dependent communication can be initiated at a rate based on therate of the internal microcontroller clock of the first electronicdevice. Thus, the ability of the timing dependent communication maydepend on the success of the calibration of the internal oscillator atstep 704.

Any normal, timing dependent or timing independent functions can beperformed after the steps of process 700 are completed. These mayinvolve performing any tasks that would have been performed even ifclock calibration from a third party device were not necessary. In someembodiments, information may be exchanged with the other devices. Infact, any suitable tasks may be performed at this point, includingchecking connections between various devices, establishing connectionsbetween various devices, providing updates to various devices, orfacilitating the transfer of data between various devices, for example.

It should also be understood that process 700 of FIG. 7 and any otherprocess described below are merely illustrative. In fact, any of theshown steps of process 700 or other processes may be omitted ormodified, and any additional steps may be performed without departingfrom the scope of the invention.

Referring now to FIG. 8, an illustrative flow diagram of a process 800is shown for calibrating a microcontroller of a first electronic device(e.g., microcontroller 312 of accessory device 300 of FIG. 3) usingtiming information from a third party device (e.g., third party device500 of FIG. 5). The steps of the flow diagram are alternative steps forthose shown in FIG. 7, and can also enable the first electronic deviceto communicate with a second electronic device (e.g., portableelectronic device 326 of FIG. 3) using a timing dependent protocol.These steps differ from those of process 700 at least because process800 ensures that proper calibration of the microcontroller clock hasoccurred before initiating communication with the second electronicdevice.

Similar to step 702 and step 704 described above, at step 802 and step804, the first electronic device can transmit a request for transmissionof timing information to the third party device and can calibrate itsmicrocontroller clock based on the timing information received from thethird party device.

Then, at step 806, the first electronic device can transmit apredetermined packet of data to the third party device. Thepredetermined packet can be of any suitable length and of any suitablepattern. The predetermined packet may be chosen such that it is unlikelyto be interpreted correctly by the third party device unless the packetis transmitted at an accurate data rate. Thus, if the third party devicecan correctly receive the packet, accurate microcontroller clockcalibration can be assumed. At step 808, the first electronic device candetermine whether communication with the third party device is possible.This determination may involve receiving an acknowledgement from thethird party device if the third party device is able to correctlyinterpret the predetermined packet. If communication is possible, thefirst electronic device can initiate timing dependent communication withanother electronic device at step 810.

If, according to the determination at step 808, communication is not yetpossible, process 800 may move back to step 804, and the firstelectronic device may again calibrate its microcontroller clock at step804. Alternatively, process 800 may instead return to step 802, and thefirst electronic device may again request transmission of timinginformation from the third party device. The first electronic device maydetermine that communication is not possible at step 808, for example,if no acknowledgement is received from the third party device within apredetermined amount of time. Thus, using the steps of flow diagram 800,the internal oscillator of the microcontroller may continually becalibrated until, at step 808, it is accurate enough for timingdependent communication.

Referring now to FIG. 9, an illustrative flow diagram of a process 900is shown for deriving timing information from at least a subset of aplurality of received timing dependent signals. A suitable electronicdevice, such as accessory device 300 of FIG. 3, can execute the steps ofprocess 900. At step 902, a plurality of timing dependent signals may bereceived. The plurality of timing dependent signals may be received froma plurality of different electronic devices. For example, accessorydevice 300 can receive a plurality of timing dependent signals fromportable electronic device 326 and third party device 328 of FIG. 3. Atstep 904, timing information can be derived from at least a subset ofthe timing dependent signals. In some embodiments, some or all of thetiming dependent signals may be averaged. In other embodiments, one ofthe timing dependent signals may be selected based on any suitablecriteria. For example, a timing dependent signal may be selected basedon which signal has the largest peak magnitude or based on which signalis obtained from the highest or lowest priority port. Then, at step 906,the first electronic device can calibrate its microcontroller clockusing the timing information derived from the plurality of timingdependent signals.

Referring now to FIG. 10, an illustrative flow diagram of a process 1000is shown for transmitting timing information for clock calibration inaccordance with an embodiment of the invention. Process 1000 can beexecuted by a third party device in order to provide timing informationto another electronic device. For example, process 1000 can be executedby third party device 500 of FIG. 5 to provide timing information toaccessory device 300 of FIG. 3, thereby allowing accessory device 300 tocalibrate its microcontroller clock.

At step 1002 of process 1000, the third party device may receive asignal from an electronic device (e.g., accessory device 300 of FIG. 3).The signal may be a timing independent signal and may be alevel-triggered or transition-triggered signal, which may be sent as arequest for timing information. In some embodiments, the timingindependent signal may be detected in the form of a voltage change on apower line or another suitable communication link.

In response to receiving the timing independent signal, the third partydevice can suspend its current activity at step 1004. For example, ifthe third party device is communicating with another electronic deviceor is running any suitable program, the third party device can suspendoperation of these functions. Then, at step 1006, the third party devicemay send timing information to the electronic device that requestedtiming information. The electronic device may use this timinginformation to calibrate its microcontroller clock.

At step 1008, the third party device can determine whether calibrationof the electronic device's microcontroller clock is complete. The thirdparty device may make this determination based on a packet sent by theelectronic device, or may assume that calibration is complete once apredetermined period of time passes. If, at step 1008, the third partydevice determines that clock calibration is not complete, the thirdparty device can continue to send timing information to the electronicdevice at step 1006. Alternatively, process 1000 can move back to step1002, and the third party device can wait for a new signal from theelectronic device that requests completion of clock calibration. If,according to the determination at step 1008, clock calibration hascompleted, the third party device can, at step 1010, resume any of theactivities that it may have previously suspended at step 1004.

It should be understood that the flow diagram of process 1000illustrated in FIG. 10 is merely illustrative. For example, in someembodiments, the third party device may not need to suspend anyactivities in order to transmit timing information. Alternatively,rather than suspending current activities, timing information may betransmitted once any current operations are completed.

FIGS. 11 and 12 show illustrative flow diagrams of processes 1100 and1200, respectively, for maintaining communication between a firstelectronic device (e.g., accessory device 300 of FIG. 3) and a secondelectronic device (e.g., portable electronic device 326 of FIG. 3) inaccordance with various embodiments of the invention. Processes 1100 and1200 can be executed by the first electronic device, such as accessorydevice 300 of FIG. 3. Thus, these flow diagrams illustrate twoapproaches for continually recalibrating the internal oscillator of thefirst electronic device's microcontroller (e.g., internal oscillator 311of microcontroller 312 of FIG. 3) to ensure that timing dependentcommunication remains possible with the second electronic device.

Referring first to FIG. 11, the flow diagram of process 1100 is shownfor maintaining communication with the second electronic device byperiodically recalibrating the internal oscillator of a microcontrollerirrespective of microcontroller clock accuracy. At step 1102, the firstelectronic device can calibrate or recalibrate its microcontrollerclock. Calibrating the microcontroller clock may involve any of thesteps described above in connection with FIGS. 7-10, for example. Afterclock calibration, the first electronic device can start communicatingor resume communicating with the second electronic device at step 1104.After a predetermined amount of time (e.g., after one second, fiveseconds, one minute, etc.), the flow of process 1100 may again return tostep 1102. That is, the microcontroller clock may again be recalibratedregardless of the accuracy of the internal oscillator. This approach mayadvantageously ensure that the internal oscillator remains accurate andreliable, and that communication capabilities do not cease.

Referring now to FIG. 12, another flow diagram is shown that illustratesa process for allowing a first electronic device to initiate and/ormaintain communication with a second electronic device. In process 1200,the microcontroller of the first electronic device is recalibrated onlywhen necessary.

At step 1202, the first electronic device may initiate communicationwith the second electronic device. The communication may be based on atiming dependent protocol, such as a USB protocol. At step 1204, thefirst electronic device may determine whether communication is possiblewith the second electronic device. In some embodiments, thedetermination can be made based on whether the second electronic deviceresponds appropriately to any information transmitted at step 1202, suchas with a return acknowledgment or with any requested information. If,at step 1204, the first electronic device determines that communicationis not possible, the first electronic device may recalibrate itsmicrocontroller clock at step 1206. Recalibrating the microcontrollerclock may involve any of the steps described above in connection withFIGS. 7-11. Once recalibrated, communication with the other device mayagain be initiated at step 1202.

If, based on the determination at step 1204, communication is possiblewith the second electronic device, the first electronic device maycontinue to communicate or start to communicate at step 1208 with thesecond electronic device. In some embodiments, actual data transferbetween the two devices may begin at step 1208, as proper communicationhas been established. Then at step 1210, the first electronic device candetermine whether a timeout in communication has occurred with thesecond electronic device. For example, a timeout in communication mayoccur when the second electronic device does not respond to informationrequests sent by the first electronic device within a predeterminedamount of time. If the first electronic device determines that a timeoutin communication has not occurred, the first electronic device cancontinue communicating with the first electronic device at step 1208.Otherwise, process 1200 can move to step 1206, and the first electronicdevice can recalibrate its internal microcontroller clock. Thus, whencommunication ceases, the first electronic device can assume that itsmicrocontroller clock has lost accuracy, and can recalibrate itsmicrocontroller clock to regain communications capabilities.

The foregoing describes systems and methods for calibrating the internaloscillator of a microcontroller based on a remote clock source. Thoseskilled in the art will appreciate that the invention can be practicedby other than the described embodiments, which are presented for thepurpose of illustration rather than of limitation, and the invention islimited only by the claims which follow.

What is claimed is:
 1. A method of enabling timing dependent communication between a first electronic device and a second electronic device, comprising: transmitting a timing independent signal from the first electronic device to a third party device to request transmission of timing information, wherein the timing independent signal is comprised of a voltage change in the timing independent signal that is detectable by the third party device; calibrating a clock source of the first electronic device based on the timing information transmitted from the third party device and received by the first electronic device, wherein the timing information is comprised of a clock signal; and conducting the timing dependent communication between the first electronic device and the second electronic device, wherein a data rate of the timing dependent communication is based on a clock rate of the clock source.
 2. The method of claim 1, wherein the transmitting the timing independent signal comprises pulsing a voltage of the timing independent signal.
 3. The method of claim 1, wherein the third party device comprises a reliable clock source, and wherein the timing information is derived from the reliable clock source.
 4. The method of claim 3, wherein the reliable clock source is a crystal oscillator.
 5. The method of claim 1, further comprising transmitting a timing dependent signal from the first electronic device to the third party device to end transmission of the timing information.
 6. The method of claim 1, further comprising: transmitting a predetermined packet from the first electronic device to the third party device using a timing dependent protocol; ending the calibrating of the clock source in response to the first electronic device receiving an acknowledgement of receipt of the predetermined packet from the third party device; and retransmitting the predetermined packet from the first electronic device to the third party device when the acknowledgement is not received by the first electronic device.
 7. The method of claim 1, wherein the timing independent signal is a first timing independent signal, the method further comprising: transmitting a second timing independent signal from the first electronic device to the third party device subsequent to the transmitting the first timing independent signal to request transmission of additional timing information; and recalibrating the clock source based on the additional timing information transmitted from the third party device and received by the first electronic device.
 8. The method of claim 7, wherein the second timing independent signal is automatically transmitted a predetermined amount of time after the transmitting the first timing independent signal.
 9. The method of claim 7, wherein the second timing independent signal is transmitted after the conducting the timing dependent communication ceases for a timeout period of time.
 10. A method of transmitting timing information from a first electronic device to a second electronic device, wherein the first electronic device comprises a reliable clock source, and wherein the second electronic device comprises a microcontroller with an internal oscillator, the method comprising: receiving a timing independent signal from the second electronic device with the first electronic device, wherein the timing independent signal is comprised of a voltage change in the timing independent signal that is detectable by the first electronic device; detecting a request for the timing information from the received timing independent signal with the first electronic device; and transmitting the timing information from the first electronic device to the second electronic device, wherein the timing information is derived from the reliable clock source, wherein the timing information is comprised of a clock signal, and wherein the timing information is used by the second electronic device to calibrate the internal oscillator of the microcontroller.
 11. The method of claim 10, wherein the detecting the request comprises detecting a voltage change of the timing independent signal.
 12. The method of claim 10, further comprising powering the first electronic device using the timing independent signal.
 13. A system, comprising: a third party device comprising a reliable clock source, wherein the third party device is configured to transmit timing information derived from the reliable clock source in response to receiving a timing independent request, wherein the timing independent signal is comprised of a voltage change in the timing independent signal that is detectable by the third party device, wherein the timing information is comprised of a clock signal; and a first electronic device coupled to the third party device, wherein the first electronic device comprises a microcontroller with an internal oscillator, and wherein the first electronic device is configured to: transmit the timing independent request to the third party device; and calibrate the internal oscillator with the timing information received from the third party device.
 14. The system of claim 13, wherein the third party device is a wireless headset, and wherein the reliable clock source is a crystal oscillator.
 15. The system of claim 13, wherein the first electronic device is a docking device adapted to be an accessory device for the third party device.
 16. The system of claim 13, further comprising a second electronic device for communicating with the first electronic device using a timing dependent protocol.
 17. The system of claim 16, wherein the second electronic device is a portable media player.
 18. An electronic device, comprising: a first communication link for transmitting, to a second electronic device, a request for timing information using a timing independent protocol, wherein the second electronic device comprises a reliable clock source, wherein the timing independent protocol is comprised of a voltage change in a timing independent signal that is detectable by the second electronic device; a second communication link for receiving the timing information, wherein the timing information is comprised of a clock signal; and a microcontroller for controlling operations of the electronic device, wherein an internal oscillator of the microcontroller is calibrated based on the received timing information.
 19. The electronic device of claim 18, wherein the first communication link is adapted for providing power to the second electronic device.
 20. The electronic device of claim 18, further comprising: a regulator for providing a first voltage and a second voltage, wherein the first voltage is different from the second voltage; and a switch for selectively providing one of the first voltage and the second voltage to the first communication link, wherein the request for the timing information is transmitted by changing a state of the switch for a period of time.
 21. A method of calibrating a clock source of a first electronic device for use in enabling timing dependent communication between the first electronic device and a second electronic device, the method comprising: transmitting a request for timing signals from the first electronic device to a plurality of third party devices using a timing independent protocol, wherein the timing independent protocol is comprised of a voltage change in a timing independent signal that is detectable by the plurality of third party devices; receiving a plurality of timing signals with the first electronic device from the plurality of third party devices in response to the request, wherein the plurality of timing signals is comprised of clock signals; deriving timing information with the first electronic device from at least a subset of the timing signals; and calibrating the clock source based on the timing information.
 22. The method of claim 21, wherein the clock source is an internal oscillator of a microcontroller within the first electronic device.
 23. The method of claim 21, wherein the deriving the timing information comprises averaging the at least a subset of the timing signals.
 24. The method of claim 21, wherein the deriving the timing information comprises selecting one of the plurality of timing signals based on at least one magnitude of the timing signals and priorities of ports of the first electronic device that obtained each of the plurality of timing signals.
 25. The method of claim 21, wherein the plurality of timing signals are received with the first electronic device from at least a subset of the plurality of third party devices. 